using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Lock
{
    public partial class LockMain : Form
    {
        public LockMain()
        {
            InitializeComponent();
        }

        //屏幕分辨率
        public int screenWidth = Screen.PrimaryScreen.Bounds.Width;
        public int screenHeight = Screen.PrimaryScreen.Bounds.Height;

        //退出后执行？
        public bool openIssue = false;

        private void beforeClosing()
        {
            //MessageBox.Show(openIssue.ToString());
            //打开Issue
            if (openIssue == true)
            {
                //MessageBox.Show("OK");
                System.Diagnostics.Process.Start("explorer.exe", "https://gitee.com/biuublog/LockYourComputer/issues");
            }
        }

        private void LockMain_Load(object sender, EventArgs e)
        {
            MinimumSize = new Size(screenWidth, screenHeight);
            MaximumSize = new Size(screenWidth, screenHeight);
            Location = new Point(0, 10);
            this.WindowState = FormWindowState.Maximized;
            //MessageBox.Show(screenWidth + "\r\n" + screenHeight + "\r\n" + SystemInformation.WorkingArea.Height + "\r\n" + (Screen.PrimaryScreen.Bounds.Height - SystemInformation.WorkingArea.Height));
        }

        private void CloseButtton_Click(object sender, EventArgs e)
        {
            if (true)
            {
                this.Close();
            }
        }

        

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            linkLabel1.Text = "配置中，请稍等...";
            openIssue = true;
            linkLabel1.Text = "配置完成！按下 EXIT 按钮退出后自动打开issue页面 Ov<";
        }

        private void DebugCloseButton_Click(object sender, EventArgs e)
        {
            beforeClosing();
            Process.GetCurrentProcess().Kill();
        }

    }
}
